<?php
  session_start();
  if ($_POST) {
    $retorno = $_POST["pageBack"];
    header("Location: $retorno");
    include("config/login-defs.php");
    $formAction = $_POST["formAction"];
    if ($formAction == "excluir") {
      //$query = "UPDATE categoria SET status = 'Inativo' WHERE id_categoria = " . $_POST["keyValue"] ;	  
      $data = mysql_query($query) or print(mysql_error());
    } else if ($formAction == "alterar") {
      $id = $_POST["id"];
      $query = 'UPDATE conta SET nome = "' . $_POST["fldNome"] . '" ' .
                    'WHERE id_conta = ' . $_POST["id"];
      $data = mysql_query($query) or print(mysql_error());
    } else if ($formAction == "inserir") {
      // SQL Insert CMS.
      $query = 'INSERT INTO conta (nome, saldo)' .
                  ' VALUES ("' . $_POST["fldNome"] . '",0)';
      $data = mysql_query($query) or print(mysql_error());	  
    }
  }
?>